import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import { unstable_HistoryRouter as HistoryRouter, BrowserRouter } from 'react-router-dom'
import { history } from './utils/history';
import { routes } from './router/index'
import { Provider } from 'react-redux';
import RouterWaiter from 'react-router-waiter' // 引入插件
import onRouteBefore from './utils/onRouteBefore' // 引入你定义的路由拦截函数
import store from './redux/store';
import 'antd/dist/antd.min.css'
const root = ReactDOM.createRoot(document.getElementById('root'));

root.render(

  <HistoryRouter history={history}>
    <Provider store={store}>
      <RouterWaiter routes={routes}
        onRouteBefore={onRouteBefore}>
        <App />
      </RouterWaiter>
    </Provider>
  </HistoryRouter>

);
